.rescol-wrapper.with-borders
  .rescol-header-wrapper
  .rescol-content-wrapper
    table
      thead
        tr
          th PID
          th Database
          th User
          th IP
          th Application
          th State
          th Query
      tbody
        each client in connections
          tr
            td= client.pid
            td
              if client.datname
                = client.datname
              else
                i.null NULL
            td= client.usename
            td= client.client_addr
            td= client.state_change ? client.application_name : client.backend_type
            td= client.state
            td
              if client.state == 'active'
                code.result.pgsql= client.query

p.buttons
  button.cancel Close
